package com.zycfc.zsf.boot.validation.validator;

import com.zycfc.zsf.boot.validation.annotation.*;
import javax.validation.*;
import com.zycfc.zsf.boot.util.validator.*;
import java.lang.annotation.*;

public class AddressValidator implements ConstraintValidator<Address, String>
{
    private boolean notEmpty;
    
    public AddressValidator() {
        this.notEmpty = false;
    }
    
    public void initialize(final Address address) {
        this.notEmpty = address.notEmpty();
    }
    
    public boolean isValid(final String value, final ConstraintValidatorContext context) {
        return AddressValidUtils.validateAddress(this.notEmpty, value);
    }
}
